<template>
  <view class="ad-section" :class="!showModule? 'hidden-content' : ''">
    <view class="ad-content" v-if="showModule" @click="handleAd">
      <image :src="adConfig.imgSrc" alt="" v-if="adConfig.imgSrc != ''" />
      <image :src="asyncImgs.diyNew.default_img" alt="" v-else />
    </view>
    <view class="hold-place" v-if="showModule"></view>
  </view>
</template>

<script>
export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  mixins: [],
  components: {},
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {
    adConfig() {
      return this.propsData.params.abConfig || {};
    },
    showModule() {
      return this.propsData.params.showModule;
    },
  },
  methods: {
    handleAd() {
      if (this.adConfig.link?.link) {
        this.$utils.diySkip(this.adConfig.link);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.ad-section {
  width: 100%;
  min-height: 154rpx;
  overflow: hidden;
  position: relative;
  z-index: 301;
  padding: 4vw 4.267vw;

  .ad-content {
    width: 100%;
    position: absolute;
    min-height: 154rpx;
    left: 0;
    top: 0;
    z-index: 301;
    padding: 4vw 4.267vw;
  }
  .hold-place {
    width: 100%;
    height: 154rpx;
  }
  image {
    width: 100%;
    height: 154rpx;
    display: block;
    border-radius: 10rpx;
    background-color: #9130fc;
  }
}
.hidden-content{
  min-height: inherit;
  padding: 0 0 2.13vw 0;
}
</style>
